#ifndef GRPCEVENTDISPATCHERCORE_H
#define GRPCEVENTDISPATCHERCORE_H

#include <string>
#include <memory>
#include "grpceventbase.h"
#include <QObject>
#include <QTimer>
#include <queue>

class EventParseHelperBase{
public:
    EventParseHelperBase();

};

class GrpcEventDispatcherCore : public QObject
{
    Q_OBJECT
public:
    GrpcEventDispatcherCore(QObject* parent = nullptr);

    //分发事件到内部
    void DispatchLocal(const std::string& jsonText);

    //分发事件到grpc
    void DispatchRemote(const std::string& eventName, EventParamNull* param,
                        std::string dst, std::string src = "SMB");


    std::map<int,  std::list<std::string >> m_waitToGo;

    std::queue<GrpcEventJsonAvis> m_waitSend;

    QTimer m_timer;
};

extern std::shared_ptr<GrpcEventDispatcherCore> g_pEventDispatcher;

#endif // GRPCEVENTDISPATCHERCORE_H
